import request from '@/utils/request'

// 查询配置列表
export function configList() {
  return request({
    url: `/sys/shopIncomeConfig/get`,
    method: 'get',
  })
}
// 更新配置
export function updateConfig(data) {
  return request({
    url: '/sys/shopIncomeConfig/edit/hierarchy',
    method: 'post',
    data:data
  })
}
// 新增层级
export function addShareConfig(data) {
  return request({
    url: '/sys/shopIncomeConfig/add/hierarchy',
    method: 'post',
    data:data
  })
}
export function delConfig(id) {
    return request({
        url: `/sys/shopIncomeConfig/del/${id}`,
        method: 'post'
      })
  }
// 查询店铺等级列表
export function storeLevelList(query) {
  return request({
    url: `/web/shop-level/all`,
    method: 'get',
    params: query
  })
}
// 更新店铺等级
export function updateStoreLevel(data) {
  return request({
    url: '/web/shop-level/put',
    method: 'put',
    data:data
  })
}
// 新增店铺等级
export function addStoreLevel(data) {
  return request({
    url: '/web/shop-level/add',
    method: 'put',
    data:data
  })
}
// 删除店铺等级详情
export function storeLevelDetails(id) {
  return request({
    url: `/web/shop-level/${id}`,
    method: 'delete'
  })
}
// 设置平台返点率
export function platform(data) {
    return request({
      url: "/sys/shopIncomeConfig/edit/platform",
      method: 'post',
      data: data
    })
  }
//设置主播返点率
export function anchor(data) {
    return request({
      url: "/sys/shopIncomeConfig/edit/anchor",
      method: 'post',
      data: data
    })
  }
// 新修改主播返点率
export function advancePayment(data) {
  return request({
    url: "/sys/shopIncomeConfig/edit/advancePayment",
    method: 'post',
    data: data
  })
}
// 修改有效店铺余额
export function effectiveShop(data) {
  return request({
    url: "/sys/shopIncomeConfig/edit/effectiveShop",
    method: 'post',
    data: data
  })
}
// 获取所有分割区间
export function rechargeGradient() {
  return request({
    url: `/sys/shop/rechargeGradient/getAll`,
    method: 'get',
  })
}

// 分割区间新增和编辑
export function rechargeGradientAdd(data) {
  return request({
    url: "/sys/shop/rechargeGradient/addOrUp",
    method: 'post',
    data: data
  })
}

// 分割区间新增和编辑
export function rechargeGradientStatus(data) {
  return request({
    url: "/sys/shop/rechargeGradient/upStatus",
    method: 'post',
    data: data
  })
}
